/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.hutech09.jsale.bsn;

import java.util.List;
import javax.ejb.Local;
import org.hutech09.jsale.bsn.exception.ItemExistsException;
import org.hutech09.jsale.bsn.exception.ItemNotFoundException;
import org.hutech09.jsale.entity.ProductType;
import org.hutech09.jsale.entity.Category;

/**
 *
 * @author Nam
 */
@Local
public interface ICategoryManager {

    public Category create(Category category);
    
    public ProductType create(ProductType productType);
    
    public void deleteCategory(long categoryId)throws ItemNotFoundException;
    
    public void deleteProductType(long productTypeId)throws ItemNotFoundException;

    public void update(Category category) throws ItemExistsException;
    
    public void update(ProductType productType) throws ItemExistsException;
    
    public List<Category> getAllCategory();
    
    public Category getCategory(Long categoryId);
    
    public List<ProductType> getAllProductType();
    
    public List<ProductType> getAllProductType(Long categoryId) throws ItemNotFoundException;
    
    public boolean isEmpty(ProductType type);
    
    public List<Category> getall();
    
    /**
     * Kiểm tra xem cos Product nào nằm trong category hiện tại hay không
     * @return 
     */
    public boolean isCategoryEmpty(Long categoryId) throws ItemNotFoundException;
}
